<script type="text/javascript">
	$(function() {
		var redirect="";
		$(".deleteBoton").click(function() {
			redirect = $(this)[0].href;
			$("#deleteWindow").dialog('open');
			return false;
		})	
		 

		
		$("#deleteWindow").dialog({
			bgiframe: true,
			resizable: false,
			autoOpen: false,			
			height:140,
			modal: true,
			overlay: {
				backgroundColor: '#000',
				opacity: 0.5
			},
			buttons: {
				'Borrar': function() {
					$(this).dialog('close');
					location.href=redirect;
					return false;
					
				},
				Cancel: function() {
					$(this).dialog('close');
					return false;
					
				}
			}
		});
	});
	</script>


<div id="deleteWindow" style="display:none" title="<?php __('action_delete',true) ?>">
<p> <?php __('msg_configuration_delete') ?></p>
</div>



<div class="kt-g1">
		<div class=" kt-right">
	   		<ul class="lst-tabs">
	   		   		<li id="icon-new"> <span class="icon"></span> <?php echo $html->link(__('configurations_new',true),$ruta_admin.'/add');?> </li>	    				
	    			<li id="icon-configuration" class="active"> <span class="icon"></span> <?php echo $html->link(__('configurations_list',true),$ruta_admin.'/');?> </li>	    				
			</ul>	  
		</div>
</div>

<div class="kt-md kt-md-content">	
		<div class="hd">
			 <h2><?php __('configurations_list') ?></h2>	
		</div>
		<div class="bd">	
			 <?php if (!is_writable(CONFIGS.'database.php')) { ?>					
		  		<div class="kt-md-group clearfix configuration">
				<p class="error_msg"> <?php  __('Your database file is NOT writable.'); ?> 
				  <?php  __('configurations will not safe and will not work correctly'); ?>
				 </p> 
			 </div>
			 <?php	} ?>
		
			<div class="searcher">
   			 <?php
echo $paginator->counter(array(
'format' => __('Total %count%, Pagina %page% de %pages%, numero de elementos %current%,  ( %start% de  %end% )',true)
)); 
?>			</div>
		  
			
						<h3><?php __('listado') ?></h3>
							<table class="lst-info"> 
						<tr class="form-field"> 
							<th>Id							</th>
							<th><?php __('proyect_name') ?>	</th>
							<th><?php __('directory') 	 ?>	</th>
							<th><?php __('creation_date')?>	</th>
							<th><?php __('actions') 	 ?> 	</th>
						</tr>
						
						<?php  
					
						if (count($configurations)>0)
							foreach ($configurations as $configuration){ 
								if ($configuration['Ktconfiguration']['id']==$id_configuracion){
						?>
						<tr class="form-field tr_activate">
						<?php } else { ?>
						<tr class="form-field">
						 <?php  } ?>
							<td><?php echo $configuration['Ktconfiguration']['id']?></td>
							<td><?php echo $html->link($configuration['Ktconfiguration']['name'], $ruta_admin."view/".$configuration['Ktconfiguration']['id']); ?></td>
							<td><?php echo $configuration['Ktconfiguration']['directory']?></td>
							<td><?php echo $configuration['Ktconfiguration']['created']?></td>
						 
							<td>
							<?php echo $html->link(__('action_edit',true), $ruta_admin."edit/".$configuration['Ktconfiguration']['id']); ?> 
							- <?php echo $html->link(__('action_delete',true), $ruta_admin."delete/".$configuration['Ktconfiguration']['id'], array('class' => 'deleteBoton')); ?>
 							- <?php echo $html->link(__('action_select',true), $ruta_admin."configuration/".$configuration['Ktconfiguration']['id']); ?>
							</td>
						</tr>
						<?php } ?>
					</table>
			
			
		</div>
		<div class="ft"> 
			 
			<p>	<?php echo $html->link(__('configurations_create_new',true), $ruta_admin."add/");?></p>
			<?php if ($paginator->next()!="" || $paginator->prev()!=""){?>
				<div class="kt-wg-paginator clear">
					<?php echo $paginator->prev('<< '.__('Previous Page', true), array(), null, array('class'=>'ant disabled'));?>
	 				 <div class="indice">	 	<?php echo $paginator->numbers();?> </div>
					<?php echo $paginator->next(__('Next Page', true).' >>', array(), null, array('class'=>'next disabled'));?>
				</div>
			<?php } ?>
		</div>
</div>